<?php

namespace Dongasai\WkProtoPhp\Packets;

use Dongasai\WkProtoPhp\Enums\FrameType;
use Dongasai\WkProtoPhp\Framer;

/**
 * PING包
 */
class PingPacket extends Framer
{
    public function __construct(Framer $framer = null)
    {
        parent::__construct(FrameType::PING->value);
        if ($framer) {
            $this->setFrameType($framer->getFrameType());
            $this->setRemainingLength($framer->getRemainingLength());
            $this->setNoPersist($framer->getNoPersist());
            $this->setRedDot($framer->getRedDot());
            $this->setSyncOnce($framer->getSyncOnce());
            $this->setDUP($framer->getDUP());
            $this->setFrameSize($framer->getFrameSize());
        }
    }

    public function __toString(): string
    {
        return 'PING';
    }
}